import 'thinkjs3-ts';
import path from 'path';
import cors from 'koa-cors';
const isDev = think.env === 'development';

export = [
      {
            handle: 'meta',
            options: {
                  logRequest: isDev,
                  sendResponseTime: isDev
            }
      },
      {
            handle: 'resource',
            enable: true,
            options: {
                  root: path.join(think.ROOT_PATH, 'www'),
                  publicPath: /^\/(static|favicon\.ico)/
            }
      },
      {
            handle: 'trace',
            enable: !think.isCli,
            options: {
                  debug: isDev
            }
      },
      {
            handle: 'payload',
            options: {
                  uploadDir: path.join(think.RUNTIME_PATH, '_tmp'),
                  keepExtensions: true,
                  limit: '5mb'
            }
      },
      {
            handle: 'router',
            options: {}
      },
      'logic',
      'controller'
];


